<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Baby信息</title>
<script type="text/javascript" src="Public/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="Public/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="Public/js/lazyload.js"></script>
<script type="text/javascript" src="Public/artDialog/artDialog.source.js?skin=default" charset="utf-8"></script>
<script type="text/javascript" src="Public/js/jquery.ae.image.resize.min.js"></script>
<script type="text/javascript" src="Public/js/province_city_county.js"></script>
<script type="text/javascript" src="Public/bootstrap/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="Public/swfupload/swfupload.js"></script>
	<script type="text/javascript" src="Public/swfupload/swfupload.queue.js"></script>
	<script type="text/javascript" src="Public/swfupload/swfupload.speed.js"></script>
	<script type="text/javascript" src="Public/swfupload/js/profile_handlers.js"></script>
<link rel="stylesheet" href="Public/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="Public/bootstrap/css/datepicker.css">
<link rel="stylesheet" href="theme/default/css/common.css">
<link rel="stylesheet" href="Public/css/homeindex.css">

  <!--[if lte IE 6]>
  <link rel="stylesheet" type="text/css" href="/Public/bootstrap/css/bootstrap-ie6.css">
  <![endif]-->
  <!--[if lte IE 7]>
  <link rel="stylesheet" type="text/css" href="/Public/bootstrap/css/ie.css">
  <![endif]-->
</head>

<body>
<include file="./template/default/Public/header-logined.html" />
 
<script type="text/javascript">
var fb_i = 2;
function fb_add(){
	$('#fb_info_wrap').append('<div id="fb_block_'+fb_i+'"><hr class="small"><div class="clearfix tab-content" id="fb_info_'+fb_i+'">  <a class="close" onclick="del_fb_info('+fb_i+')" data-dismiss="alert" title="删除">×</a>        <div class="control-group">            <label class="control-label" for="fb_name_'+fb_i+'">宝宝姓名</label>            <div class="controls">              <input type="text" class="input-xlarge" id="fb_name_'+fb_i+'" name="fb_name[]">              <p class="help-block">		请输入真实姓名，保密	      </p>            </div>          </div>          <div class="control-group">            <label class="control-label" for="fb_sex_1"><i>*</i>宝宝性别</label>            <div class="controls">             <label class="radio"><input type="radio" name="fb_sex[]" id="fb_sex_1" value="1" />男孩</label>              <label class="radio"><input type="radio" name="fb_sex[]" id="fb_sex_0" value="0" />女孩</label>              <p class="help-block">			      </p>            </div>          </div>                    <div class="control-group">            <label class="control-label" for="fb_borndate">宝宝出生日期：</label>            <div class="controls">               <input type="text" name="fb_borndate[]" id="fb_borndate_'+fb_i+'" class="input-xlarge">                <p class="help-block"><div class="alert alert-info">(宝宝的生日一旦填写将不能随意修改，如有变更请发邮件到客服邮箱facesbaby@126.com申请，申请时请务必注明您的用户昵称、注册邮箱和宝宝的正确生日日期。)</div>	      </p>            </div>          </div></div></div>');
	fb_i++;

}
function del_fb_info(fb_num){
	$("#fb_block_"+fb_num).remove();
}
function jumpStep(step){
	if(step!=""){
	//
	$.ajax({
		
	});	
	}
}
</script>
    <div class="container main">
      <div class="row-fluid">
        <div class="span3">
          <include file="./template/default/Public/sidebar.html" />
        </div><!--/span-->
        <div class="content span9">

         
          <div class="well">
          	<div class="page-header"><h3>Baby信息</h3></div>
            <ul class="nav nav-tabs" id="fb_info_nav">
<?php
$i_=0;
?>
  <volist name="result" id="rs">
  <?php
  if(empty($rs['baby_realname'])){
  	$realname=$rs['baby_nickname'];
  }else{
  	$realname = $rs['baby_realname'];
  }

  if($i_==0){
  ?>
  <li class="active"><a href="#baby_<?php echo $i_;?>" data-toggle="tab" class="tab_link">{$realname}</a></li>
  <?php
  }else{
  ?>
  <li><a href="#baby_<?php echo $i_;?>" data-toggle="tab" class="tab_link">{$realname}</a></li>
  <?php
  }
  $i_++;
  ?>
  </volist>
  <li><a href="/index.php?s=/Home/Baby/Add"><i class="icon-plus-sign"></i>添加</a></li>
</ul>
<form class="form-horizontal" action="/index.php?s=/Home/Baby/doUpdate" method="post" id="fb_form">
<div class="tab-content" style="background:#fff;">

<?php
$j=0;
?>
	<volist name="result" id="rs_">
   <?php
   if($j==0){
   	$active_str = ' active';
   }else{
   $active_str = '';
   }
   ?>
	<div class="tab-pane{$active_str}" id="baby_<?php echo $j;?>">


<fieldset>
<div id="fb_info_wrap">
<div class="clearfix tab-content" id="fb_info_{$rs_['baby_id']}">
		  <input type="hidden" name="fb_babyid[]" value="{$rs_['baby_id']}">
          
          
          <div class="control-group">
            <label class="control-label" for="fb_name_{$rs_['baby_id']}">宝宝目前</label>
            <div class="controls">
              <select name="fb_pregnant_{$rs_['baby_id']}" id="fb_pregnant_{$rs_['baby_id']}">
              <option value="1" selected>已出生</option>
              <option value="2">怀孕中</option>
              </select>
            </div>
          </div>
          
          <script type="text/javascript">
		  $(function(){
			 $("#fb_pregnant_{$rs_['baby_id']}").val("{$rs_['baby_pregnant']}"); 
		  });
		  </script>
		  
         
         <div class="control-group">
            <label class="control-label" for="fb_nickname_{$rs_['baby_id']}">宝宝昵名</label>
            <div class="controls">
              <input type="text" class="input-xlarge" id="fb_nickname_{$rs_['baby_id']}" value="{$rs_['baby_nickname']}" name="fb_nickname_{$rs_['baby_id']}">
              <p class="help-block">
	      </p>
            </div>
          </div>
          	
          <div class="control-group">
            <label class="control-label" for="fb_name_1">宝宝姓名</label>
            <div class="controls">
              <input type="text" class="input-xlarge" id="fb_name_{$rs_['baby_id']}" name="fb_name_{$rs_['baby_id']}" value="{$rs_['baby_realname']}">
              <p class="help-block">
		请输入真实姓名，保密
	      </p>
            </div>
          </div>
          <div class="control-group">
          	<label class="control-label">上传宝宝头像</label>
            <div class="controls">
            <div id="preview_{$rs_['baby_id']}"><img src="{$rs_['baby_icon']}"></div>
            <script type="text/javascript">
			var swfu_{$rs_['baby_id']};			
				var settings_{$rs_['baby_id']} = {
				flash_url : "/Public/swfupload/swfupload.swf",
				flash9_url : "/Public/swfupload/swfupload_fp9.swf",
				upload_url: "http://<?php echo $_SERVER['HTTP_HOST'];?>/?s=/Home/Baby/ProfilePhotoPost",
				post_params: {"babyid":"<?php echo $rs_['baby_id'];?>" },
				file_size_limit : "5 MB",
				file_types : "*.jpg",
				file_types_description : "All Files",
				file_upload_limit : 1,
				file_queue_limit : 0,

				debug: false,

				// Button settings
				button_image_url: "/Public/images/XPButtonUploadText_61x22.png",
				button_width: "61",
				button_height: "22",
				button_placeholder_id: "spanButtonPlaceHolder_{$rs_['baby_id']}",
				
				moving_average_history_size: 40,
				
				// The event handler functions are defined in handlers.js
				swfupload_preload_handler : preLoad,
				swfupload_load_failed_handler : loadFailed,
				file_queued_handler : fileQueued,
				file_dialog_complete_handler: fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				
				custom_settings : {
					babyid:<?php echo $rs_['baby_id'];?>
				}
			};
$(document).ready(function(){
	swfu_{$rs_['baby_id']} = new SWFUpload(settings_{$rs_['baby_id']});
});
			</script>
            	<div id="spanButtonPlaceHolder_{$rs_['baby_id']}"></div>
                
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="fb_sex_{$rs_['baby_id']}"><i>*</i>宝宝性别</label>
            <div class="controls">
             <label class="radio"><input type="radio" name="fb_sex_{$rs_['baby_id']}" id="fb_sex_{$rs_['baby_id']}_1" value="1" />男孩</label>
              <label class="radio"><input type="radio" name="fb_sex_{$rs_['baby_id']}" id="fb_sex_{$rs_['baby_id']}_0" value="0" />女孩</label>
              <label class="radio"><input type="radio" name="fb_sex_{$rs_['baby_id']}" id="fb_sex_{$rs_['baby_id']}_2" value="2" />不清楚</label>
              <p class="help-block">
		
	      </p>
          <script type="text/javascript">
		  $(function(){
			$('#fb_sex_{$rs_['baby_id']}_{$rs_["baby_sex"]}').attr('checked','checked');  
		  });
		  </script>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="fb_borndate_{$rs_['baby_id']}">宝宝预产期：</label>
            <div class="controls">
            <?php
            if(empty($rs_['baby_expectedate'])){
            	$baby_expectedate='';
            }else{
            	$baby_expectedate=date('Y-m-d',$rs_['baby_expectedate']);
            }
            ?>
<div class="input-append date fb_expectedate" data-date="">
  <input type="text" class="span2" size="16" name="fb_expectedate_{$rs_['baby_id']}" id="fb_borndate_{$rs_['baby_id']}" value="<?php echo $baby_expectedate;?>" style="width:200px" readonly>
  <span class="add-on"><i class="icon-th"></i></span>
</div> 
              
              <p class="help-block">
<!--<div class="alert alert-info">

</div>-->
</p>
              </div>
              </div>
<?php
if(empty($rs_['baby_borndate'])){
	$baby_borndate = '';
}else{
	$baby_borndate = date('Y-m-d',$rs_['baby_borndate']);
}
?>              
          <div class="control-group">
            <label class="control-label" for="fb_borndate_1">宝宝出生日期：</label>
            <div class="controls">
<div class="input-append date fb_borndate" data-date="">
  <input type="text" name="fb_borndate_{$rs_['baby_id']}" id="fb_borndate_{$rs_['baby_id']}" value="<?php echo $baby_borndate;?>" class="span2" style="width:200px" readonly>
  <span class="add-on"><i class="icon-th"></i></span>
</div> 
              
              <p class="help-block">
<div class="alert alert-info">
(宝宝的生日一旦填写将不能随意修改，如有变更请发邮件到客服邮箱facesbaby@126.com申请，申请时请务必注明您的用户昵称、注册邮箱和宝宝的正确生日日期。)
</div>
	      </p>
            </div>
          </div>
</div><!--end fb_info_1--> 


</div><!--end fb_info_wrap-->       
          
          <div class="form-actions">
            <button type="submit" class="btn btn-green">确定修改</button>
            
          </div>
          




 
          
</fieldset>       


    </div>
    
<?php
$j++;
?>
    </volist>
    
</div>
</form>
<script type="text/javascript">
$(function(){
/*	$('#fb_info_nav a.tab_link').click(function (e) {
  e.preventDefault();
  $(this).tab('show');
	});*/
$('#fb_info_nav a').click(function (e) {
 /* e.preventDefault();
  $(this).tab('show');*/
  e.target // activated tab
  e.relatedTarget // previous tab
})
	
	$('.fb_expectedate').datepicker({
	format: 'yyyy-mm-dd'	
	}).on('changeDate',function(ev){
		$('.fb_expectedate').datepicker('hide');
	});
	$('.fb_borndate').datepicker({
	format: 'yyyy-mm-dd'	
	}).on('changeDate',function(ev){
		$('.fb_borndate').datepicker('hide');
	});
	
});
</script>
            
            
          </div><!--end well-->
         
        </div><!--/span-->
      </div><!--/row-->
      
      </div>


<include file="./template/default/Public/footer-logined.html" />


</body>
</html>